<%@page import="java.util.List"%>
<%@page import="com.fyp.ptma.model.Application"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%-- <%@taglib uri="http://www.springframework.org/security/tags" --%>
<%-- 	prefix="security"%> --%>
<%@ page session="false"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>${pageTitle}</title>

<!-- JS LINKS -->

<script src="../resources/js/jquery-1.8.2.min.js"></script>
<script src="../resources/js/jquery.popupoverlay.js"></script>





<!-- CSS Link -->
<link rel="stylesheet" type="text/css"
	href="../resources/css/popup-overlay.css" media="screen" />
<link rel="stylesheet" type="text/css" href="../resources/css/home.css"
	media="screen" />

</head>
<body>
	<!-- Add a button which will open the modal -->
	
	<div id='header_new'>
		<div class='nav'>
			<a href='/ptma'><div class='logo'>
					<h2>${ptma}</h2>
					<h3>${slogon }</h3>
				</div></a>
			<ul>
				<li class="pop"><a href='fileUpload.html'>Upload Build</a></li>


			</ul>
		</div>
	</div>
	<a href="" style="left: 50px"></a>
	<div class='corkboard '>
		<div class='blueprint_bin'>
			<div class="blueprint_light">
				<%
					List<Application> applications = (List<Application>) request
							.getAttribute("applications");
					for (int i = 0, j = 0; i < applications.size(); i++) {
						if (i == 0)
							j += 250;
						else
							j += 80;
						out.print("<div class='contentsBody' style='margin-bottom:20px'>");

						out.print("<img style='margin-top:5px' width=\"70px\" height=\"70px\"");
						out.print("src='../resources/images/apkimg.png'/>");

						out.print("<a class=\"appLink\" href=\"appDetail.html?pkg=");
						out.print(i);
						out.print("\">");
						out.print(applications.get(i).getApplicationName() + "</a>");
						//out.print("<button class=\"addDownloader_open\">Open modal</button>");
						out.print("<a class=\"_addDownloader_open\" href=\"#");
						//out.print(i);
						out.print("\">");
						out.print("Add downloaders</a>");

						out.print("<a class=\"assignGroup\" href=\"assignGroup.html?pkg=");
						out.print(i);
						out.print("\">");
						out.print("Assign Group</a>");

						//Delete
						out.print("<a class=\"appDeleteLink\" href=\"deleteApplication.html?pkg=");
						out.print(i);
						out.print("\">");
						out.print("Delete application</a>");

						out.print("</div>");

					}
				%>



			</div>
			<div class="blueprint_light_bot"></div>
		</div>
		<!-- blueprint_bin -->
		<div class='dev_bulletin'></div>
	</div>
	<div class='corkboard_frame'></div>




	<!-- Add content to modal -->
	<div id="_addDownloader" class="well" style="display: none; margin: 1em;">
		<a href="#" class="_addDownloader_close"
			style="float: right; padding: 0 0.4em;">x</a>
			<iframe src="appDetail.html" width="100%" height="100%"></iframe>
		<h4>Modal overlay example</h4>
		<p>
			Try to change the width and height of browser window, or to rotate
			your tablet device, and also try to navigate with
			<kbd>Tab</kbd>
			key.
		</p>
		<p>
			You can close the dialog by pressing the
			<kbd>Esc</kbd>
			key, or by clicking on the background outside the content area, or by
			clicking on the Close button.
		</p>
		<p>
			If you don't want to show the outline around the container when
			focused, you can remove it with
			<code>.overlay {outline: none}.</code>
		</p>
		<form>
			<button class="btn btn-alert _addDownloader_close">Close</button>
		</form>
	</div>

	<script>
		$(function() {
			$('#_addDownloader').popup();
		});
	</script>


</body>
</html>